{extend name='admin@main'}

{block name="button"}
<!--{if auth("currency/cleaner/add")}-->
<button data-modal='{:url("add")}' data-title="添加保洁员" class='layui-btn layui-btn-sm layui-btn-primary'>添加保洁员</button>
<!--{/if}-->
<!--{if auth("currency/cleaner/remove")}-->
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除保洁员</button>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='cleaner/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>用户信息</th>
            <th class='text-left nowrap'>账户信息</th>
            <th class='text-left nowrap'>状态</th>
            <th class='text-left nowrap'></th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>
                {notempty name='vo.work_headimg'}
                <img data-tips-image style="width:60px;height:60px;vertical-align:top" src="{$vo.work_headimg|default=''}" class="margin-right-5">
                {/notempty}
                <div class="inline-block">
                    会员姓名：{$vo.name|default='--'}<br>
                    会员昵称：{$vo.nickname|default='--'}<br>
                    会员手机：{$vo.phone|default='--'}<br>
                </div>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block">
                    余额：<strong class="color-blue">{$vo.balance + 0}</strong><span class="text-explode">|</span>
                    <a class="layui-btn layui-btn-sm" data-open="{:url('balance_log')}?id={$vo.id}">记 录</a>
                </div>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block">
                    用户状态：{if $vo.status eq 1}<strong class="color-green">正常</strong>{elseif $vo.status eq 0}<strong class="color-red">已禁用</strong>{/if}<br>
                    工作状态：{if $vo.work_state eq 1}<strong class="color-green">正常</strong>{elseif $vo.work_state eq 0}<strong class="color-red">休息</strong>{/if}<br>
                    实名状态：{if $vo.auth_state eq 1}<strong class="color-green">已实名</strong>{elseif $vo.auth_state eq 0}<strong class="color-red">未实名</strong>{/if}<br>
                    银行卡：{if $vo.bind_bank_status}<strong class="color-green">已绑定</strong>{else}<strong class="color-red">未绑定</strong>{/if}<br>
                </div>
            </td>
            <td class='text-left'>{$vo.create_at}</td>
            <td class="text-left">
                <div class="nowrap margin-bottom-5">
                    <a class="layui-btn layui-btn-sm" data-open="{:url('relation')}?id={$vo.id}">关 系</a>
                    <span class="text-explode">|</span>
                    {if auth("currency/cleaner/edit")}
                    <a data-dbclick data-title="编辑用户" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}' data-value="id#{$vo.id};status#0">编 辑</a>
                    <span class="text-explode">|</span>
                    {/if}
                    <a class="layui-btn layui-btn-sm" data-open="{:url('customer')}?id={$vo.id}">客 户</a>
                </div>
                <div class="nowrap margin-bottom-5">
                    <a class="layui-btn layui-btn-sm" data-open="{:url('rebate')}?id={$vo.id}">收 益</a>
                    <span class="text-explode">|</span>
                    {if $vo.status eq 1 and auth("currency/cleaner/forbid")}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('currency/cleaner/forbid')}">禁 用</a>
                    <span class="text-explode">|</span>
                    {elseif $vo.status eq 0 and auth("currency/cleaner/resume")}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('currency/cleaner/resume')}">启 用</a>
                    <span class="text-explode">|</span>
                    {/if}

                    {if auth("currency/cleaner/remove")}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该用户吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('currency/cleaner/remove')}">删 除</a>
                    {/if}
                </div>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}